const cloud = require('wx-server-sdk')
const db = cloud.database()

exports.main = async (event, context) => {
  const todos = await db.collection('commentList');
  return await todos.add({
    // data 字段表示需新增的 JSON 数据
    data: {
      openid: event.openid,
      desc: event.desc,
      datestr: event.datestr,
      isShow:false
    },
    success: function(res) {
      console.log("插入数据库成功："+res)
      return res.data;//返回用户信息
    }
  })
}